#include <iostream>
#include <cassert>
using namespace std;

class Date
{
	friend inline ostream& operator<<(ostream& out, const Date& d);
	friend inline istream& operator>>(istream& in, Date& d);
public:
	int GetMonthDays()
	{
		static int month[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
		if (IsLeapYear() && _month == 2)
			return 29;
		else
			return month[_month];

	}
	bool IsLeapYear()
	{
		if ((_year % 4 == 0 && _year % 100 != 0) || (_year % 400 == 0))
			return true;
		else
			return false;
	}
	bool CheckDate()
	{
		if (_year >= 0
			&& _month > 0 && _month < 13
			&& _day >0 && _day <= GetMonthDays())
			return true;
		else
			return false;
	}
	Date(int year = 1, int month = 1, int day = 1)
		:_year(year)
		,_month(month)
		,_day(day)
	{}
	bool operator!=(const Date& d) const
	{
		return !(*this == d);
	}
	bool operator==(const Date& d) const
	{
		if (_year == d._year && _month == d._month && _day == d._day)
			return true;
		else
			return false;
	}
	bool operator>=(const Date& d) const
	{
		return *this == d || *this > d;
	}
	bool operator<=(const Date& d) const
	{
		return !(*this > d);
	}
	bool operator>(const Date& d) const
	{
		if ((_year > d._year)
			|| (_year == d._year && _month > d._month)
			|| (_year == d._year && _month == d._month && _day > d._day))
			return true;
		else
			return false;
	}
	bool operator<(const Date& d) const
	{
		return !(*this >= d);
	}
	Date operator+(int days)
	{
		Date ret(*this);
		ret += days;
		return ret;
	}
	Date& operator+=(int days)
	{
		if (days < 0)
		{
			return *this -= -days;
		}
		_day += days;
		while (_day > GetMonthDays())
		{
			_day -= GetMonthDays();
			_month++;
			if (_month == 13)
			{
				_year++;
				_month = 1;
			}
		}
		return *this;
	}

	Date operator-(int days)
	{
		Date ret(*this);
		ret -= days;
		return ret;
	}
	Date& operator-=(int days)
	{
		if (days < 0)
		{
			return *this += -days;
		}
		_day -= days;
		while (_day < 0)
		{
			_month--;
			if (_month == 0)
			{
				_year--;
				_month = 12;
			}
			_day += GetMonthDays();
		}
		return *this;
	}

	Date& operator++()
	{
		*this += 1;
		return *this;
	}
	Date operator++(int)
	{
		Date ret(*this);
		*this += 1;
		return ret;
	}
	Date& operator--()
	{
		*this -= 1;
		return *this;
	}
	Date operator--(int)
	{
		Date ret(*this);
		*this -= 1;
		return ret;
	}
	void Print()
	{
		cout << _year << "-" << _month << "-" << _day << endl;
	}
	int operator-(const Date& d) const
	{
		int flag = 1;
		Date max(*this);
		Date min(d);
		if (max < min)
		{
			flag = -1;
			max = d;
			min = *this;
		}
		int count = 0;
		while (min != max)
		{
			min++;
			count++;
		}
		return count * flag;
	}
private:
	int _year;
	int _month;
	int _day;
};

inline ostream& operator<<(ostream& out, const Date& d)
{
	out << d._year << ":" << d._month << ":" << d._day << endl;
	return out;
}

inline istream& operator>>(istream& in, Date& d)
{
	in >> d._year >> d._month >> d._day;
	assert(d.CheckDate());

	return in;
}

int main()
{
	//Date d1(2023, 8, 31);
	/*(d1 + 1).Print();
	(d1 + 10).Print();
	(d1 + 100).Print();
	(d1 + 1000).Print();
	(d1 + 10000).Print();*/

	/*(d1 - 1).Print();
	(d1 - 10).Print();
	(d1 - 100).Print();
	(d1 - 1000).Print();
	(d1 - 10000).Print();
	(d1 - 36500).Print();*/

	Date d1;
	Date d2;
	cin >> d1 >> d2;
	cout << d1 - d2 << endl;
	
	return 0;
}